



//
//  MBSectionOneVC.m
//  房源详情-小区详情
//
//  Created by MB__Lee on 2018/5/28.
//  Copyright © 2018年 MB__Lee. All rights reserved.
//

#import "MBSectionOneVC.h"
#import "MBZuFangVC.h" //租房
#import "MBZuWuPinVC.h" // 租物品
#import "MBZuFuWuVC.h"  // 租服务
#import "MBOtherVC.h"   // 其他




@interface MBSectionOneVC ()

@property(nonatomic,strong)NSArray *titleArr;

@end

@implementation MBSectionOneVC
-(NSArray *)titleArr{
    if (!_titleArr) {
        _titleArr  = @[@"租房",@"租物品",@"租服务",@"其他"];
    }
    return _titleArr;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    
 

    
   
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController {
    return  4;
}

- (NSString *)pageController:(WMPageController *)pageController titleAtIndex:(NSInteger)index {
    return  self.titleArr[index];
}

- (UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index {
    UIViewController *vc = nil;
    if (index == 0 ) {
        vc = [[MBZuFangVC alloc] init];
    }else if (index == 1){
        vc = [[MBZuWuPinVC alloc] init];
    }else if (index == 2){
        vc = [[MBZuFuWuVC alloc] init];
    }else if (index == 3){
        vc  = [[MBOtherVC alloc] init];
    }
    return  vc;
}
-(CGRect)pageController:(WMPageController *)pageController preferredFrameForMenuView:(WMMenuView *)menuView{
    
    CGRect frame =  CGRectMake(0, 0, SCREEN_WIDTH, 35);
    return  frame;
}
-(CGRect)pageController:(WMPageController *)pageController preferredFrameForContentView:(WMScrollView *)contentView{
    CGRect frame1 = CGRectMake(0, 36, SCREEN_WIDTH, 171);
    return  frame1;
}
-(CGFloat)menuView:(WMMenuView *)menu titleSizeForState:(WMMenuItemState)state atIndex:(NSInteger)index{
    return  15;
}
-(UIColor *)menuView:(WMMenuView *)menu titleColorForState:(WMMenuItemState)state atIndex:(NSInteger)index{
    
    if (state == WMMenuItemStateNormal) {
        return MBLineColor;
    }else if (state  == WMMenuItemStateSelected){
        return  MB_mainSelectedColor;
    }
    return  nil;
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
